#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int bei(int m, int n, int y)
{
	return m*n / y;
}
int yue(int m, int n)
{
	if (m < n)
	{
		int temp = m;
		m = n;
		n = temp;
	}
	while (m%n != 0)
	{
		int temp = m % n;
		m = n;
		n = temp;
	}
	return n;
}
int main()
{
	int m, n;
	scanf("%d%d", &m, &n);
	int y = yue(m, n);
	int b = bei(m, n, y);
	printf("%d %d\n", y, b);
	return 0;
}